import Vue from 'vue';
import Router from 'vue-router';
import Module1 from './module1';
import housingestate from "./housingestate";
import Mobile from './mobile';
import project from './project';

Vue.use(Router);

export default new Router({
    mode: 'hash',
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/dashboard',
                    component: resolve => require(['../components/page/Dashboard.vue'], resolve),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/icon',
                    component: resolve => require(['../components/page/Icon.vue'], resolve),
                    meta: { title: '自定义图标' }
                },
                {
                    path: '/module1/index',
                    component: resolve => require(['../components/module1/Index'], resolve),
                    meta: { title: '权限管理' },
                    children: Module1
                },
                {
                    path: '/housingestate/index',
                    component: resolve => require(['../components/housingestate/Index'], resolve),
                    meta: { title: '小区管理' },
                    children: housingestate
                },
                {
                    path: '/forum',
                    component: resolve => require(['../components/forum/Forum'], resolve),
                    meta: { title: '论坛管理' },
                },
                {
                    path: '/convenient',
                    component: resolve => require(['../components/convenient/Convenient'], resolve),
                    meta: { title: '便民信息管理' },
                },
                {
                    path: '/report',
                    component: resolve => require(['../components/report/report'], resolve),
                    meta: { title: '举报管理' },
                },
                {
                    path: '/project/index',
                    component: resolve => require(['../components/project/Index'], resolve),
                    meta: { title: '项目管理' },
                    children: project
                },
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
        {
            path: '/mobile',
            component: resolve => require(['../components/mobile/Index.vue'], resolve),
            children: Mobile
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
